package com.hliushi.lock.service.impl;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hliushi.lock.entity.Dlock;
import com.hliushi.lock.mapper.DlockMapper;
import com.hliushi.lock.service.DlockService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class DlockServiceImpl extends ServiceImpl<DlockMapper, Dlock> implements DlockService {

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteByMethodName(String methodName) {
        boolean remove = super.remove(Wrappers.<Dlock>lambdaQuery()
                .eq(StringUtils.isNotEmpty(methodName), Dlock::getMethodName, methodName));
    }
}
